package com.loser.excel.core;


import cn.afterturn.easypoi.handler.inter.IExcelExportServer;
import com.loser.excel.constant.CheckExportIsReturn;
import com.loser.excel.utils.ExceptionUtils;

import java.util.List;
import java.util.Objects;

/**
 * 导出服务类
 *
 * @author alan
 * @date 2022/6/10 12:04
 */
public class CmsExcelService implements IExcelExportServer {

    @Override
    @SuppressWarnings("all")
    @CheckExportIsReturn
    public List<Object> selectListForExcelExport(Object queryParams, int page) {
        ExcelExportParams params = (ExcelExportParams) queryParams;
        CmsSearchExcelDataService exportServer = params.getExportServer();
        if (Objects.isNull(exportServer)) {
            ExceptionUtils.fail("导出业务类未设置");
        }
        return exportServer.selectListForExcelExport(params, page);
    }

}
